import React from "react";
import "./App.css";
// 引入 antd-mobile 组件的样式
import "antd-mobile/dist/antd-mobile.css";
import { BrowserRouter, Switch, Redirect, Route } from "react-router-dom";
// import RouterView, { routes } from "./router";
import Login from "./pages/Login.jsx";
import Detail from "./pages/Detail.jsx";
import Index from "./pages/Index.jsx";

function App() {
    return (
        <div className="app">
            <BrowserRouter>
                <Switch>
                    <Redirect exact from="/" to="/bwl/list" />
                    <Route exact path="/login" component={Login} />
                    <Route exact path="/bwl/detail/:id" component={Detail} />
                    <Route path="/bwl" component={Index} />
                </Switch>
            </BrowserRouter>
        </div>
    );

    // return (
    //     <div className="App">
    //         <BrowserRouter>
    //             <Switch>
    //                 <Redirect exact from="/" to="/bwl/list" />
    //                 <RouterView routes={routes} />
    //             </Switch>
    //         </BrowserRouter>
    //     </div>
    // );
}

export default App;
